USE [umbraco]
GO
/****** Object:  Table [dbo].[procureVersion]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[procureVersion](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Version] [int] NOT NULL,
	[CreatedOn] [datetime] NOT NULL,
	[AppliedOn] [datetime] NOT NULL,
 CONSTRAINT [PK_Version] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[procureVersion] ON
INSERT [dbo].[procureVersion] ([Id], [Version], [CreatedOn], [AppliedOn]) VALUES (1, 1, CAST(0x00009D0300000000 AS DateTime), CAST(0x00009D0301028571 AS DateTime))
INSERT [dbo].[procureVersion] ([Id], [Version], [CreatedOn], [AppliedOn]) VALUES (3, 3, CAST(0x00009B9700B240D0 AS DateTime), CAST(0x00009D0400B267B3 AS DateTime))
SET IDENTITY_INSERT [dbo].[procureVersion] OFF
/****** Object:  Table [dbo].[procureUser]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureUser](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ApplicationName] [varchar](50) NOT NULL,
	[Username] [varchar](50) NOT NULL,
	[IsAnonymous] [bit] NOT NULL,
	[LastActiveOn] [datetime] NOT NULL,
	[LastUpdatedOn] [datetime] NOT NULL,
 CONSTRAINT [PK_procureUser] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[procureUser] ON
INSERT [dbo].[procureUser] ([Id], [ApplicationName], [Username], [IsAnonymous], [LastActiveOn], [LastUpdatedOn]) VALUES (1, N'procure', N'b141f551-72f8-4ba7-bab4-37419a9b62a2', 1, CAST(0x00009D0600A82245 AS DateTime), CAST(0x00009D0600A82245 AS DateTime))
INSERT [dbo].[procureUser] ([Id], [ApplicationName], [Username], [IsAnonymous], [LastActiveOn], [LastUpdatedOn]) VALUES (2, N'procure', N'scott', 0, CAST(0x00009D0600000000 AS DateTime), CAST(0x00009D0600000000 AS DateTime))
SET IDENTITY_INSERT [dbo].[procureUser] OFF
/****** Object:  Table [dbo].[procureStatus]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureStatus](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[SortOrder] [int] NOT NULL,
	[VisibleInAdmin] [bit] NOT NULL,
	[MoveToStatusId] [int] NULL,
	[Editable] [bit] NOT NULL,
	[Global] [bit] NOT NULL,
 CONSTRAINT [PK_OrderStatus] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[procureStatus] ON
INSERT [dbo].[procureStatus] ([Id], [Name], [SortOrder], [VisibleInAdmin], [MoveToStatusId], [Editable], [Global]) VALUES (2, N'Submitted', 1, 1, 3, 1, 0)
INSERT [dbo].[procureStatus] ([Id], [Name], [SortOrder], [VisibleInAdmin], [MoveToStatusId], [Editable], [Global]) VALUES (3, N'Paid', 2, 1, 4, 1, 0)
INSERT [dbo].[procureStatus] ([Id], [Name], [SortOrder], [VisibleInAdmin], [MoveToStatusId], [Editable], [Global]) VALUES (4, N'Shipped', 4, 1, 5, 1, 0)
INSERT [dbo].[procureStatus] ([Id], [Name], [SortOrder], [VisibleInAdmin], [MoveToStatusId], [Editable], [Global]) VALUES (5, N'Completed', 5, 0, NULL, 0, 0)
INSERT [dbo].[procureStatus] ([Id], [Name], [SortOrder], [VisibleInAdmin], [MoveToStatusId], [Editable], [Global]) VALUES (6, N'Cancelled', 6, 1, NULL, 0, 1)
INSERT [dbo].[procureStatus] ([Id], [Name], [SortOrder], [VisibleInAdmin], [MoveToStatusId], [Editable], [Global]) VALUES (7, N'Invoiced', 3, 1, 4, 1, 1)
SET IDENTITY_INSERT [dbo].[procureStatus] OFF
/****** Object:  Table [dbo].[procureProductType]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureProductType](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
 CONSTRAINT [PK_ProductType] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[procureProductType] ON
INSERT [dbo].[procureProductType] ([Id], [Name]) VALUES (1, N'Processor')
INSERT [dbo].[procureProductType] ([Id], [Name]) VALUES (2, N'Hard Disk')
INSERT [dbo].[procureProductType] ([Id], [Name]) VALUES (4, N'Keyboard')
SET IDENTITY_INSERT [dbo].[procureProductType] OFF
/****** Object:  Table [dbo].[procureDataType]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureDataType](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
 CONSTRAINT [PK_DataType_1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[procureDataType] ON
INSERT [dbo].[procureDataType] ([Id], [Name]) VALUES (1, N'Number')
INSERT [dbo].[procureDataType] ([Id], [Name]) VALUES (2, N'Text')
INSERT [dbo].[procureDataType] ([Id], [Name]) VALUES (3, N'True/False')
SET IDENTITY_INSERT [dbo].[procureDataType] OFF
/****** Object:  Table [dbo].[procureCheckoutScreen]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureCheckoutScreen](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[NextCheckoutScreen] [int] NULL,
 CONSTRAINT [PK_CheckoutScreen] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[procureCart]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[procureCart](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[UserId] [int] NOT NULL,
	[CreatedOn] [datetime] NOT NULL,
	[UpdatedOn] [datetime] NOT NULL,
	[Subtotal] [money] NOT NULL,
	[Shipping] [money] NOT NULL,
	[Tax] [money] NOT NULL,
	[Total] [money] NOT NULL,
 CONSTRAINT [PK_Cart] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[procureCart] ON
INSERT [dbo].[procureCart] ([Id], [UserId], [CreatedOn], [UpdatedOn], [Subtotal], [Shipping], [Tax], [Total]) VALUES (1, 1, CAST(0x00009D0600A8227E AS DateTime), CAST(0x00009D0600A8227E AS DateTime), 20.0000, 10.0000, 1.0000, 31.0000)
SET IDENTITY_INSERT [dbo].[procureCart] OFF
/****** Object:  Table [dbo].[procureAttribute]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureAttribute](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[DataTypeId] [int] NOT NULL,
 CONSTRAINT [PK_Attribute_1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[procureAttribute] ON
INSERT [dbo].[procureAttribute] ([Id], [Name], [DataTypeId]) VALUES (2, N'Clock Speed', 1)
INSERT [dbo].[procureAttribute] ([Id], [Name], [DataTypeId]) VALUES (3, N'Manufacturing Process', 1)
INSERT [dbo].[procureAttribute] ([Id], [Name], [DataTypeId]) VALUES (4, N'RPM', 1)
INSERT [dbo].[procureAttribute] ([Id], [Name], [DataTypeId]) VALUES (5, N'Brand', 2)
INSERT [dbo].[procureAttribute] ([Id], [Name], [DataTypeId]) VALUES (6, N'NCQ', 3)
INSERT [dbo].[procureAttribute] ([Id], [Name], [DataTypeId]) VALUES (7, N'Keys', 1)
SET IDENTITY_INSERT [dbo].[procureAttribute] OFF
/****** Object:  Table [dbo].[procureProduct]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureProduct](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](100) NOT NULL,
	[Description] [varchar](1000) NOT NULL,
	[StockNumber] [varchar](20) NOT NULL,
	[ProductTypeId] [int] NOT NULL,
	[Weight] [decimal](18, 4) NOT NULL,
	[Price] [money] NOT NULL,
	[ShippingBase] [money] NOT NULL,
	[ShippingUnit] [money] NOT NULL,
	[ShippingCase] [int] NOT NULL,
 CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[procureProduct] ON
INSERT [dbo].[procureProduct] ([Id], [Name], [Description], [StockNumber], [ProductTypeId], [Weight], [Price], [ShippingBase], [ShippingUnit], [ShippingCase]) VALUES (2, N'Microsoft Natural Keyboard', N'Ergonomic Keyboard', N'MSNAT', 4, CAST(1.0000 AS Decimal(18, 4)), 49.9500, 5.0000, 3.5000, 3)
INSERT [dbo].[procureProduct] ([Id], [Name], [Description], [StockNumber], [ProductTypeId], [Weight], [Price], [ShippingBase], [ShippingUnit], [ShippingCase]) VALUES (7, N'Western Digital 1TB 7200RPM SATA Drive', N'Western Digital 1TB 7200RPM SATA Drive', N'WD1TB7200S', 2, CAST(1.0000 AS Decimal(18, 4)), 50.0000, 15.2300, 10.6200, 5)
SET IDENTITY_INSERT [dbo].[procureProduct] OFF
/****** Object:  Table [dbo].[procureOrder]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[procureOrder](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[UserId] [int] NOT NULL,
	[StatusId] [int] NOT NULL,
	[OrderedOn] [datetime] NOT NULL,
	[UpdatedOn] [datetime] NOT NULL,
	[Subtotal] [money] NOT NULL,
	[Shipping] [money] NOT NULL,
	[Tax] [money] NOT NULL,
	[Total] [money] NOT NULL,
 CONSTRAINT [PK_Order] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[procureOrder] ON
INSERT [dbo].[procureOrder] ([Id], [UserId], [StatusId], [OrderedOn], [UpdatedOn], [Subtotal], [Shipping], [Tax], [Total]) VALUES (2, 2, 7, CAST(0x00009D0600000000 AS DateTime), CAST(0x00009D0600000000 AS DateTime), 20.0000, 10.0000, 1.0000, 31.0000)
SET IDENTITY_INSERT [dbo].[procureOrder] OFF
/****** Object:  Table [dbo].[procureProductTypeAttribute]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[procureProductTypeAttribute](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ProductTypeId] [int] NOT NULL,
	[AttributeId] [int] NOT NULL,
	[Mandatory] [bit] NOT NULL,
	[SortOrder] [int] NOT NULL,
 CONSTRAINT [PK_ProductTypeAttribute_1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[procureProductTypeAttribute] ON
INSERT [dbo].[procureProductTypeAttribute] ([Id], [ProductTypeId], [AttributeId], [Mandatory], [SortOrder]) VALUES (1, 1, 2, 1, 2)
INSERT [dbo].[procureProductTypeAttribute] ([Id], [ProductTypeId], [AttributeId], [Mandatory], [SortOrder]) VALUES (2, 1, 2, 1, 3)
INSERT [dbo].[procureProductTypeAttribute] ([Id], [ProductTypeId], [AttributeId], [Mandatory], [SortOrder]) VALUES (3, 1, 5, 1, 1)
INSERT [dbo].[procureProductTypeAttribute] ([Id], [ProductTypeId], [AttributeId], [Mandatory], [SortOrder]) VALUES (4, 2, 5, 1, 1)
INSERT [dbo].[procureProductTypeAttribute] ([Id], [ProductTypeId], [AttributeId], [Mandatory], [SortOrder]) VALUES (5, 2, 4, 1, 2)
INSERT [dbo].[procureProductTypeAttribute] ([Id], [ProductTypeId], [AttributeId], [Mandatory], [SortOrder]) VALUES (6, 2, 6, 0, 3)
INSERT [dbo].[procureProductTypeAttribute] ([Id], [ProductTypeId], [AttributeId], [Mandatory], [SortOrder]) VALUES (7, 4, 5, 1, 1)
SET IDENTITY_INSERT [dbo].[procureProductTypeAttribute] OFF
/****** Object:  Table [dbo].[procureProductAttributeValue]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureProductAttributeValue](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ProductId] [int] NOT NULL,
	[AttributeId] [int] NOT NULL,
	[AttributeValue] [varchar](1000) NOT NULL,
 CONSTRAINT [PK_ProductAttributeValue_1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[procureProductAttributeValue] ON
INSERT [dbo].[procureProductAttributeValue] ([Id], [ProductId], [AttributeId], [AttributeValue]) VALUES (1, 2, 5, N'Microsoft')
INSERT [dbo].[procureProductAttributeValue] ([Id], [ProductId], [AttributeId], [AttributeValue]) VALUES (2, 7, 5, N'Western Digital')
INSERT [dbo].[procureProductAttributeValue] ([Id], [ProductId], [AttributeId], [AttributeValue]) VALUES (3, 7, 4, N'7200')
INSERT [dbo].[procureProductAttributeValue] ([Id], [ProductId], [AttributeId], [AttributeValue]) VALUES (4, 7, 6, N'1')
SET IDENTITY_INSERT [dbo].[procureProductAttributeValue] OFF
/****** Object:  Table [dbo].[procureOrderStatusHistory]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[procureOrderStatusHistory](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[OrderId] [int] NOT NULL,
	[StatusId] [int] NOT NULL,
	[MovedToOn] [datetime] NOT NULL,
	[MovedToBy] [varchar](50) NOT NULL,
 CONSTRAINT [PK_OrderStatusHistory] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[procureOrderStatusHistory] ON
INSERT [dbo].[procureOrderStatusHistory] ([Id], [OrderId], [StatusId], [MovedToOn], [MovedToBy]) VALUES (2, 2, 3, CAST(0x00009D0600EC4061 AS DateTime), N'')
INSERT [dbo].[procureOrderStatusHistory] ([Id], [OrderId], [StatusId], [MovedToOn], [MovedToBy]) VALUES (3, 2, 4, CAST(0x00009D0600EC78B6 AS DateTime), N'')
INSERT [dbo].[procureOrderStatusHistory] ([Id], [OrderId], [StatusId], [MovedToOn], [MovedToBy]) VALUES (4, 2, 6, CAST(0x00009D0600EC8B65 AS DateTime), N'')
INSERT [dbo].[procureOrderStatusHistory] ([Id], [OrderId], [StatusId], [MovedToOn], [MovedToBy]) VALUES (5, 2, 7, CAST(0x00009D0600ECB5E4 AS DateTime), N'')
SET IDENTITY_INSERT [dbo].[procureOrderStatusHistory] OFF
/****** Object:  Table [dbo].[procureOrderProduct]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[procureOrderProduct](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[OrderId] [int] NOT NULL,
	[ProductId] [int] NOT NULL,
	[Quantity] [int] NOT NULL,
	[Price] [money] NOT NULL,
	[ShippingBase] [money] NOT NULL,
	[ShippingUnit] [money] NOT NULL,
	[ShippingCase] [int] NOT NULL,
	[ShippingTotal] [money] NOT NULL,
 CONSTRAINT [PK_OrderProduct] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[procureOrderProduct] ON
INSERT [dbo].[procureOrderProduct] ([Id], [OrderId], [ProductId], [Quantity], [Price], [ShippingBase], [ShippingUnit], [ShippingCase], [ShippingTotal]) VALUES (1, 2, 7, 2, 10.0000, 10.0000, 5.0000, 2, 15.0000)
SET IDENTITY_INSERT [dbo].[procureOrderProduct] OFF
/****** Object:  Table [dbo].[procureCartProduct]    Script Date: 01/22/2010 14:24:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[procureCartProduct](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CartId] [int] NOT NULL,
	[ProductId] [int] NOT NULL,
	[Quantity] [int] NOT NULL,
	[Price] [money] NOT NULL,
	[ShippingBase] [money] NOT NULL,
	[ShippingUnit] [money] NOT NULL,
	[ShippingCase] [int] NOT NULL,
	[ShippingTotal] [money] NOT NULL,
 CONSTRAINT [PK_CartProduct] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Default [DF_Version_AppliedOn]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureVersion] ADD  CONSTRAINT [DF_Version_AppliedOn]  DEFAULT (getdate()) FOR [AppliedOn]
GO
/****** Object:  ForeignKey [FK_Attribute_DataType]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureAttribute]  WITH CHECK ADD  CONSTRAINT [FK_Attribute_DataType] FOREIGN KEY([DataTypeId])
REFERENCES [dbo].[procureDataType] ([Id])
GO
ALTER TABLE [dbo].[procureAttribute] CHECK CONSTRAINT [FK_Attribute_DataType]
GO
/****** Object:  ForeignKey [FK_Cart_User]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureCart]  WITH CHECK ADD  CONSTRAINT [FK_Cart_User] FOREIGN KEY([UserId])
REFERENCES [dbo].[procureUser] ([Id])
GO
ALTER TABLE [dbo].[procureCart] CHECK CONSTRAINT [FK_Cart_User]
GO
/****** Object:  ForeignKey [FK_CartProduct_Cart]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureCartProduct]  WITH CHECK ADD  CONSTRAINT [FK_CartProduct_Cart] FOREIGN KEY([CartId])
REFERENCES [dbo].[procureCart] ([Id])
GO
ALTER TABLE [dbo].[procureCartProduct] CHECK CONSTRAINT [FK_CartProduct_Cart]
GO
/****** Object:  ForeignKey [FK_CartProduct_Product]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureCartProduct]  WITH CHECK ADD  CONSTRAINT [FK_CartProduct_Product] FOREIGN KEY([ProductId])
REFERENCES [dbo].[procureProduct] ([Id])
GO
ALTER TABLE [dbo].[procureCartProduct] CHECK CONSTRAINT [FK_CartProduct_Product]
GO
/****** Object:  ForeignKey [FK_CheckoutScreen_CheckoutScreen]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureCheckoutScreen]  WITH CHECK ADD  CONSTRAINT [FK_CheckoutScreen_CheckoutScreen] FOREIGN KEY([NextCheckoutScreen])
REFERENCES [dbo].[procureCheckoutScreen] ([Id])
GO
ALTER TABLE [dbo].[procureCheckoutScreen] CHECK CONSTRAINT [FK_CheckoutScreen_CheckoutScreen]
GO
/****** Object:  ForeignKey [FK_Order_Status1]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureOrder]  WITH CHECK ADD  CONSTRAINT [FK_Order_Status1] FOREIGN KEY([StatusId])
REFERENCES [dbo].[procureStatus] ([Id])
GO
ALTER TABLE [dbo].[procureOrder] CHECK CONSTRAINT [FK_Order_Status1]
GO
/****** Object:  ForeignKey [FK_Order_User]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureOrder]  WITH CHECK ADD  CONSTRAINT [FK_Order_User] FOREIGN KEY([Id])
REFERENCES [dbo].[procureUser] ([Id])
GO
ALTER TABLE [dbo].[procureOrder] CHECK CONSTRAINT [FK_Order_User]
GO
/****** Object:  ForeignKey [FK_OrderProduct_Order]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureOrderProduct]  WITH CHECK ADD  CONSTRAINT [FK_OrderProduct_Order] FOREIGN KEY([OrderId])
REFERENCES [dbo].[procureOrder] ([Id])
GO
ALTER TABLE [dbo].[procureOrderProduct] CHECK CONSTRAINT [FK_OrderProduct_Order]
GO
/****** Object:  ForeignKey [FK_OrderProduct_Product]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureOrderProduct]  WITH CHECK ADD  CONSTRAINT [FK_OrderProduct_Product] FOREIGN KEY([ProductId])
REFERENCES [dbo].[procureProduct] ([Id])
GO
ALTER TABLE [dbo].[procureOrderProduct] CHECK CONSTRAINT [FK_OrderProduct_Product]
GO
/****** Object:  ForeignKey [FK_OrderStatusHistory_Order]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureOrderStatusHistory]  WITH CHECK ADD  CONSTRAINT [FK_OrderStatusHistory_Order] FOREIGN KEY([OrderId])
REFERENCES [dbo].[procureOrder] ([Id])
GO
ALTER TABLE [dbo].[procureOrderStatusHistory] CHECK CONSTRAINT [FK_OrderStatusHistory_Order]
GO
/****** Object:  ForeignKey [FK_OrderStatusHistory_Status]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureOrderStatusHistory]  WITH CHECK ADD  CONSTRAINT [FK_OrderStatusHistory_Status] FOREIGN KEY([StatusId])
REFERENCES [dbo].[procureStatus] ([Id])
GO
ALTER TABLE [dbo].[procureOrderStatusHistory] CHECK CONSTRAINT [FK_OrderStatusHistory_Status]
GO
/****** Object:  ForeignKey [FK_Product_ProductType]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureProduct]  WITH CHECK ADD  CONSTRAINT [FK_Product_ProductType] FOREIGN KEY([ProductTypeId])
REFERENCES [dbo].[procureProductType] ([Id])
GO
ALTER TABLE [dbo].[procureProduct] CHECK CONSTRAINT [FK_Product_ProductType]
GO
/****** Object:  ForeignKey [FK_ProductAttributeValue_Attribute]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureProductAttributeValue]  WITH CHECK ADD  CONSTRAINT [FK_ProductAttributeValue_Attribute] FOREIGN KEY([AttributeId])
REFERENCES [dbo].[procureAttribute] ([Id])
GO
ALTER TABLE [dbo].[procureProductAttributeValue] CHECK CONSTRAINT [FK_ProductAttributeValue_Attribute]
GO
/****** Object:  ForeignKey [FK_ProductAttributeValue_Product]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureProductAttributeValue]  WITH CHECK ADD  CONSTRAINT [FK_ProductAttributeValue_Product] FOREIGN KEY([ProductId])
REFERENCES [dbo].[procureProduct] ([Id])
GO
ALTER TABLE [dbo].[procureProductAttributeValue] CHECK CONSTRAINT [FK_ProductAttributeValue_Product]
GO
/****** Object:  ForeignKey [FK_ProductTypeAttribute_Attribute]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureProductTypeAttribute]  WITH CHECK ADD  CONSTRAINT [FK_ProductTypeAttribute_Attribute] FOREIGN KEY([AttributeId])
REFERENCES [dbo].[procureAttribute] ([Id])
GO
ALTER TABLE [dbo].[procureProductTypeAttribute] CHECK CONSTRAINT [FK_ProductTypeAttribute_Attribute]
GO
/****** Object:  ForeignKey [FK_ProductTypeAttribute_ProductType]    Script Date: 01/22/2010 14:24:31 ******/
ALTER TABLE [dbo].[procureProductTypeAttribute]  WITH CHECK ADD  CONSTRAINT [FK_ProductTypeAttribute_ProductType] FOREIGN KEY([ProductTypeId])
REFERENCES [dbo].[procureProductType] ([Id])
GO
ALTER TABLE [dbo].[procureProductTypeAttribute] CHECK CONSTRAINT [FK_ProductTypeAttribute_ProductType]
GO
